import http from '@/api/request.js'

export default function () {
  return {
    // 获取用户信息
    getUserInfo: (data) => {
      return http.post('/backend/admin/user/login', data)
    },
    //用户注册
    signinUser: (data) => {
      return http.post('/backend/admin/user/create', data)
    },
    // 获取用户列表
    getUserList: (data) => {
      return http.post('/backend/admin/user/usermanager/get-list', data)
    },
    // 添加用户
    createUser: (data) => {
      console.log(data)
      return http.post('/backend/admin/user/usermanager/create', data)
    },
    // 更新用户
    updateUser: (data) => {
      return http.post('/backend/admin/user/usermanager/update', data)
    },
    // 角色列表
    getRoleList: (data) => {
      return http.post('/backend/admin/role/list', data)
    },
    //删除用户
    deleteUser: (data) => {
      return http.post('/backend/admin/user/usermanager/delete', {
        id: data
      })
    },
    //锁定用户
    lockUser: (data) => {
      return http.post('/backend/admin/user/usermanager/lock', {
        id:data
      })
    }
  }
}
